package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IHomePageFragmentModel;
import com.wgts.wgts.mvp.model.imp.HomePageFragmentModel;
import com.wgts.wgts.mvp.presenter.IHomePageFragmentPersenter;
import com.wgts.wgts.mvp.presenter.imp.HomePageFragmentPersenter;
import com.wgts.wgts.mvp.view.IHomePageFragmentView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

@Module
public class HomePageFragmentModule {
    private IHomePageFragmentView view;

    public HomePageFragmentModule(IHomePageFragmentView view) {
        this.view = view;
    }

    @FragmentScope
    @Provides
    public IHomePageFragmentView provideView(){
        return view;
    }

    @FragmentScope
    @Provides
    public IHomePageFragmentModel provideModel(NetService netService){
        return new HomePageFragmentModel(netService);
    }

    @FragmentScope
    @Provides
    public IHomePageFragmentPersenter providePersenter(IHomePageFragmentModel model, IHomePageFragmentView view){
        return new HomePageFragmentPersenter(view, model);
    }
}
